<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>  </title>
</head>
<body>
    <form action="">
        <div>
            <label for="">用户名</label>
            <input type="text" id="username">
        </div>

        <div>
            <label for="">密码</label>
            <input type="password" id="password">
        </div>

        <div>
            <button type="button" onclick="resetForm()">重置</button>
            <button type="button" onclick="formDate()">登录</button>
        </div>
    </form>
</body>
<script src="./lib/jquery.min.js"></script>
<script>
    /*val()  括号里有参数是写  无参数是读*/

    function resetForm(){
        $("#username").val("lisi");
        $("#password").val("123");
    }

    function formDate(){            
        var yhm = $("#username").val();
        var mm = $("#password").val();
        alert(yhm + ',' +mm)
    }

</script>
</html>